﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using project.Models;
using PagedList;
using PagedList.Mvc;

namespace project.General
{
    public static class DataClass
    {
        
        //connetstring
        public static DataCenterEntities db = new DataCenterEntities();
        
        //
        // category
        //
        // function crate 
       public static void ThemDanhMuc(Term cateogory)
            {
                Term Cat = new Term();
                Cat.Name = cateogory.Name;
                Cat.Slug = cateogory.Slug;
                db.Terms.Add(Cat);
                db.SaveChanges();
            }
        //public static List<Term> GetAllCategory(int PageSize,int ? page =1)
        //{
        //    int pagenumber = (page??1);
        //    var data = db.Terms.ToList();
        //    return data.ToPagedList(pagenumber,PageSize);
        //}
        //public string _createTrees(int num)
        //{
        //    string _rs = "";
        //    for(int i=0;i<null;i++)
        //    {
        //        _rs += "-";
        //    }
        //    return _rs;
        //} 
     

        // function edit

        // function xoa
    }
    
}